package com.shuqi.controller;

import android.content.Context;

import com.shuqi.interfaces.IEventListener;
import com.shuqi.model.ThirdAccountUnbindModel;

/**
 * 
 * @author yaozhen 绑定账号的controller，包含 手机号绑定，邮箱绑定
 */
public class ThirdAccountUnbindController extends ControllerBase {

    /** 第三方账号的类型：新浪 */
    public static final int TYPE_SINA = 1;
    /** 第三方账号的类型：腾讯QQ */
    public static final int TYPE_QQ = 2;
    /** 第三方账号的类型：renren */
    public static final int TYPE_RENREN = 3;

    private ThirdAccountUnbindModel mUnbindmodel; // 绑定账号的model

    public ThirdAccountUnbindController(Context context) {
        mUnbindmodel = new ThirdAccountUnbindModel(context);
    }

    @Override
    public void addEventListener(IEventListener listener) {
        mUnbindmodel.addEventListener(listener);
    }

    @Deprecated
    @Override
    public void handle(int eventType, Object... obj) {}

    /**
     * @param uid
     * @param type 第三方类型 1表示新浪， 目前只有新浪
     * @param opentId 第三方key
     */
    public void unBind(String uid, final int type, final String opentId) {
        mUnbindmodel.unBind(uid, type, opentId);
    }

    @Override
    public void onDestroy() {
        if (mUnbindmodel != null) {
            mUnbindmodel.onDestroy();
        }
    }
}
